package alp.starcode.sanping.dict.controller;

import alp.starcode.common.web.result.Result;
import alp.starcode.sanping.dataapply.service.MapDataService;
import alp.starcode.sanping.dict.service.DictService;
import alp.starcode.sanping.dict.vo.DictDataVO;
import alp.starcode.sanping.framework.database.mariadb.mybatis.entity.MapData;
import io.swagger.annotations.*;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

/**
 * TODO
 *
 * @author wujie
 * @date 2024/3/21 12:32
 */
@Api(tags = "数据字典")
@RestController
@RequestMapping("dict")
@Validated
public class DictController {

    @Resource
    DictService dictService;

    @GetMapping("getCyType.do")
    @ApiOperation("数据字典-获取产业类型")
    @ApiImplicitParams({
    })
    @ApiOperationSupport(order = 10)
    public Result<List<DictDataVO>> getCyType() {
        return Result.success(dictService.getDictDataList("SP_CY_TYPE"));
    }

    @GetMapping("getInformType.do")
    @ApiOperation("数据字典-获取通知类型")
    @ApiImplicitParams({
    })
    @ApiOperationSupport(order = 20)
    public Result<List<DictDataVO>> getInformType() {
        return Result.success(dictService.getDictDataList("SP_INFORM_TYPE"));
    }

    @GetMapping("getRegion.do")
    @ApiOperation("数据字典-获取地区")
    @ApiImplicitParams({
    })
    @ApiOperationSupport(order = 30)
    public Result<List<DictDataVO>> getRegion() {
        return Result.success(dictService.getDictDataList("SP_REGION"));
    }

}
